package com.zhoug.commonlib2.notifycation;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import com.zhoug.commonlib2.MyBaseActivity;
import com.zhoug.commonlib2.Params;
import com.zhoug.commonlib2.R;

/**
 * @Author: zhoug
 * @Date: 2024-11-16
 * @Description:
 */
public class DetailActivity extends MyBaseActivity {
    private TextView mTvContent;
    private String mContent;

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_detail;
    }

    @Override
    protected void findViews() {
        mTvContent = findViewById(R.id.tv_content);
    }

    @Override
    protected void onCreate1(Bundle savedInstanceState) {
        parseIntent(getIntent());
        setContent();
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        parseIntent(intent);
        setContent();
    }

    private void setContent(){
        if(mContent!=null){
            mTvContent.setText(mContent);
        }else{
            mTvContent.setText("消息内容");
        }

    }

    private void parseIntent(Intent intent){
        if(null !=intent){
            mContent=intent.getStringExtra(Params.CONTENT);
        }
    }


}
